package com.example.javamaday.leetcode;

import java.util.ArrayList;
import java.util.List;

public class LeetCodeTest0448 {

    public static void main(String[] args) {

    }

    public List<Integer> findDisappearedNumbers(int[] nums) {
        int[] resultHelper = new int[nums.length + 1];
        for (int i = 1; i <= nums.length; i++) {
            resultHelper[i] = i;
        }
        for (int i = 0; i < nums.length; i++) {
            resultHelper[nums[i]] = -1;
        }
        ArrayList<Integer> result = new ArrayList<>();
        for (int i = 0; i < resultHelper.length; i++) {
            if (resultHelper[i] != -1) {
                result.add(resultHelper[i]);
            }
        }
        return result;
    }

}
